//
//  NSDecimalNumber+Extension.h
//  RuiHeAppApp
//
//  Created by Yan Chen on 2024/5/16.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDecimalNumber (Extension)
///保留n位小数,不四舍五入
+ (NSString*)decimalPlacesWithoutRoundDownWithDigit:(int)digit value:(double)value;
///保留n位小数,四舍五入
+ (NSString*)decimalPlacesWithRoundUpWithDigit:(int)digit value:(double)value;
///浮点型返回number  , value作了判空处理
+ (NSDecimalNumber*)decimalNumberWithDouble:(double)value;
///浮点型返回string,去除末尾0,如果value为空,返回0
+ (NSString*)decimalStringWithDouble:(double)value;
///浮点型返回string,去除末尾0,如果value为空,返回指定字符
+ (NSString*)decimalStringWithDouble:(double)value nullStr:(NSString*)placeHoldStr;
/// 浮点型返回string,去除末尾0,如果value为空,返回指定字符
/// - Parameters:
///   - value: 值
///   - placeHoldStr: 值为空时的占位符
+ (NSString*)decimalStringWithDoubleString:(NSString*)value nullStr:(NSString*)placeHoldStr;
@end

NS_ASSUME_NONNULL_END
